3.887 \(\int \frac{d+e x}{x^2 \left (a+b x+c x^2\right )} \, dx\)

Optimal. Leaf size=104 \[ -\frac{\left (-a b e-2 a c d+b^2 d\right ) \tanh ^{-1}\left (\frac{b+2 c x}{\sqrt{b^2-4 a c}}\right )}{a^2 \sqrt{b^2-4 a c}}+\frac{(b d-a e) \log \left (a+b x+c x^2\right )}{2 a^2}-\frac{\log (x) (b d-a e)}{a^2}-\frac{d}{a x} \]

[Out]

-(d/(a*x)) - ((b^2*d - 2*a*c*d - a*b*e)*ArcTanh[(b + 2*c*x)/Sqrt[b^2 - 4*a*c]])/
(a^2*Sqrt[b^2 - 4*a*c]) - ((b*d - a*e)*Log[x])/a^2 + ((b*d - a*e)*Log[a + b*x +
c*x^2])/(2*a^2)

_______________________________________________________________________________________

Rubi [A]  time = 0.299235, antiderivative size = 104, normalized size of antiderivative = 1., number of steps used = 6, number of rules used = 5, integrand size = 21, \(\frac{\text{number of rules}}{\text{integrand size}}\) = 0.238 \[ -\frac{\left (-a b e-2 a c d+b^2 d\right ) \tanh ^{-1}\left (\frac{b+2 c x}{\sqrt{b^2-4 a c}}\right )}{a^2 \sqrt{b^2-4 a c}}+\frac{(b d-a e) \log \left (a+b x+c x^2\right )}{2 a^2}-\frac{\log (x) (b d-a e)}{a^2}-\frac{d}{a x} \]

Antiderivative was successfully verified.

[In]  Int[(d + e*x)/(x^2*(a + b*x + c*x^2)),x]

[Out]

-(d/(a*x)) - ((b^2*d - 2*a*c*d - a*b*e)*ArcTanh[(b + 2*c*x)/Sqrt[b^2 - 4*a*c]])/
(a^2*Sqrt[b^2 - 4*a*c]) - ((b*d - a*e)*Log[x])/a^2 + ((b*d - a*e)*Log[a + b*x +
c*x^2])/(2*a^2)

_______________________________________________________________________________________

Rubi in Sympy [A]  time = 41.9602, size = 94, normalized size = 0.9 \[ - \frac{d}{a x} + \frac{\left (a e - b d\right ) \log{\left (x \right )}}{a^{2}} - \frac{\left (a e - b d\right ) \log{\left (a + b x + c x^{2} \right )}}{2 a^{2}} - \frac{\left (- a b e - 2 a c d + b^{2} d\right ) \operatorname{atanh}{\left (\frac{b + 2 c x}{\sqrt{- 4 a c + b^{2}}} \right )}}{a^{2} \sqrt{- 4 a c + b^{2}}} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]  rubi_integrate((e*x+d)/x**2/(c*x**2+b*x+a),x)

[Out]

-d/(a*x) + (a*e - b*d)*log(x)/a**2 - (a*e - b*d)*log(a + b*x + c*x**2)/(2*a**2)
- (-a*b*e - 2*a*c*d + b**2*d)*atanh((b + 2*c*x)/sqrt(-4*a*c + b**2))/(a**2*sqrt(
-4*a*c + b**2))

_______________________________________________________________________________________

Mathematica [A]  time = 0.166385, size = 100, normalized size = 0.96 \[ \frac{\frac{2 \left (-a b e-2 a c d+b^2 d\right ) \tan ^{-1}\left (\frac{b+2 c x}{\sqrt{4 a c-b^2}}\right )}{\sqrt{4 a c-b^2}}+(b d-a e) \log (a+x (b+c x))+2 \log (x) (a e-b d)-\frac{2 a d}{x}}{2 a^2} \]

Antiderivative was successfully verified.

[In]  Integrate[(d + e*x)/(x^2*(a + b*x + c*x^2)),x]

[Out]

((-2*a*d)/x + (2*(b^2*d - 2*a*c*d - a*b*e)*ArcTan[(b + 2*c*x)/Sqrt[-b^2 + 4*a*c]
])/Sqrt[-b^2 + 4*a*c] + 2*(-(b*d) + a*e)*Log[x] + (b*d - a*e)*Log[a + x*(b + c*x
)])/(2*a^2)

_______________________________________________________________________________________

Maple [A]  time = 0.011, size = 180, normalized size = 1.7 \[ -{\frac{d}{ax}}+{\frac{e\ln \left ( x \right ) }{a}}-{\frac{\ln \left ( x \right ) bd}{{a}^{2}}}-{\frac{\ln \left ( c{x}^{2}+bx+a \right ) e}{2\,a}}+{\frac{\ln \left ( c{x}^{2}+bx+a \right ) bd}{2\,{a}^{2}}}-{\frac{be}{a}\arctan \left ({(2\,cx+b){\frac{1}{\sqrt{4\,ac-{b}^{2}}}}} \right ){\frac{1}{\sqrt{4\,ac-{b}^{2}}}}}-2\,{\frac{cd}{a\sqrt{4\,ac-{b}^{2}}}\arctan \left ({\frac{2\,cx+b}{\sqrt{4\,ac-{b}^{2}}}} \right ) }+{\frac{{b}^{2}d}{{a}^{2}}\arctan \left ({(2\,cx+b){\frac{1}{\sqrt{4\,ac-{b}^{2}}}}} \right ){\frac{1}{\sqrt{4\,ac-{b}^{2}}}}} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]  int((e*x+d)/x^2/(c*x^2+b*x+a),x)

[Out]

-d/a/x+e*ln(x)/a-1/a^2*ln(x)*b*d-1/2/a*ln(c*x^2+b*x+a)*e+1/2/a^2*ln(c*x^2+b*x+a)
*b*d-1/a/(4*a*c-b^2)^(1/2)*arctan((2*c*x+b)/(4*a*c-b^2)^(1/2))*b*e-2/a/(4*a*c-b^
2)^(1/2)*arctan((2*c*x+b)/(4*a*c-b^2)^(1/2))*c*d+1/a^2/(4*a*c-b^2)^(1/2)*arctan(
(2*c*x+b)/(4*a*c-b^2)^(1/2))*b^2*d

_______________________________________________________________________________________

Maxima [F]  time = 0., size = 0, normalized size = 0. \[ \text{Exception raised: ValueError} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]  integrate((e*x + d)/((c*x^2 + b*x + a)*x^2),x, algorithm="maxima")

[Out]

Exception raised: ValueError

_______________________________________________________________________________________

Fricas [A]  time = 0.399175, size = 1, normalized size = 0.01 \[ \left [\frac{{\left (a b e -{\left (b^{2} - 2 \, a c\right )} d\right )} x \log \left (\frac{b^{3} - 4 \, a b c + 2 \,{\left (b^{2} c - 4 \, a c^{2}\right )} x +{\left (2 \, c^{2} x^{2} + 2 \, b c x + b^{2} - 2 \, a c\right )} \sqrt{b^{2} - 4 \, a c}}{c x^{2} + b x + a}\right ) +{\left ({\left (b d - a e\right )} x \log \left (c x^{2} + b x + a\right ) - 2 \,{\left (b d - a e\right )} x \log \left (x\right ) - 2 \, a d\right )} \sqrt{b^{2} - 4 \, a c}}{2 \, \sqrt{b^{2} - 4 \, a c} a^{2} x}, -\frac{2 \,{\left (a b e -{\left (b^{2} - 2 \, a c\right )} d\right )} x \arctan \left (-\frac{\sqrt{-b^{2} + 4 \, a c}{\left (2 \, c x + b\right )}}{b^{2} - 4 \, a c}\right ) -{\left ({\left (b d - a e\right )} x \log \left (c x^{2} + b x + a\right ) - 2 \,{\left (b d - a e\right )} x \log \left (x\right ) - 2 \, a d\right )} \sqrt{-b^{2} + 4 \, a c}}{2 \, \sqrt{-b^{2} + 4 \, a c} a^{2} x}\right ] \]

Verification of antiderivative is not currently implemented for this CAS.

[In]  integrate((e*x + d)/((c*x^2 + b*x + a)*x^2),x, algorithm="fricas")

[Out]

[1/2*((a*b*e - (b^2 - 2*a*c)*d)*x*log((b^3 - 4*a*b*c + 2*(b^2*c - 4*a*c^2)*x + (
2*c^2*x^2 + 2*b*c*x + b^2 - 2*a*c)*sqrt(b^2 - 4*a*c))/(c*x^2 + b*x + a)) + ((b*d
 - a*e)*x*log(c*x^2 + b*x + a) - 2*(b*d - a*e)*x*log(x) - 2*a*d)*sqrt(b^2 - 4*a*
c))/(sqrt(b^2 - 4*a*c)*a^2*x), -1/2*(2*(a*b*e - (b^2 - 2*a*c)*d)*x*arctan(-sqrt(
-b^2 + 4*a*c)*(2*c*x + b)/(b^2 - 4*a*c)) - ((b*d - a*e)*x*log(c*x^2 + b*x + a) -
 2*(b*d - a*e)*x*log(x) - 2*a*d)*sqrt(-b^2 + 4*a*c))/(sqrt(-b^2 + 4*a*c)*a^2*x)]

_______________________________________________________________________________________

Sympy [F(-1)]  time = 0., size = 0, normalized size = 0. \[ \text{Timed out} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]  integrate((e*x+d)/x**2/(c*x**2+b*x+a),x)

[Out]

Timed out

_______________________________________________________________________________________

GIAC/XCAS [A]  time = 0.272307, size = 142, normalized size = 1.37 \[ \frac{{\left (b d - a e\right )}{\rm ln}\left (c x^{2} + b x + a\right )}{2 \, a^{2}} - \frac{{\left (b d - a e\right )}{\rm ln}\left ({\left | x \right |}\right )}{a^{2}} + \frac{{\left (b^{2} d - 2 \, a c d - a b e\right )} \arctan \left (\frac{2 \, c x + b}{\sqrt{-b^{2} + 4 \, a c}}\right )}{\sqrt{-b^{2} + 4 \, a c} a^{2}} - \frac{d}{a x} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]  integrate((e*x + d)/((c*x^2 + b*x + a)*x^2),x, algorithm="giac")

[Out]

1/2*(b*d - a*e)*ln(c*x^2 + b*x + a)/a^2 - (b*d - a*e)*ln(abs(x))/a^2 + (b^2*d -
2*a*c*d - a*b*e)*arctan((2*c*x + b)/sqrt(-b^2 + 4*a*c))/(sqrt(-b^2 + 4*a*c)*a^2)
 - d/(a*x)